﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using MySql.Data.MySqlClient;
using System.Data;

namespace ProjectBuilder
{
    [DbTable("phpdoc_method")]
    public class Method : BaseDocObject
    {        
        [DbField("class_id")]
        public long? ClassId { get; set; }

        [DbField("name")]
        public string Name { get; set; }

        [DbField("static", IsUniqField = false)]
        public int Static { get; set; }

        [DbField("is_abstract", IsUniqField = false)]
        public int IsAbstract { get; set; }

        [DbField("access", IsUniqField = false)]
        public string Access { get; set; }

        [DbField("line", IsUniqField = false)]
        public int Line { get; set; }

        [DbField("return_type", IsUniqField = false)]
        public string Return { get; set; }

        [DbField("short_description", IsUniqField = false)]
        public string ShortDescription { get; set; }

        [DbField("description", IsUniqField = false)]
        public string Description { get; set; }

        public Method(ProjectBuilder.PhpDocTypes.Method metod, long? classId)
        {
            Name = metod.Name;
            Line = metod.Line;
            Return = metod.Return;
            Static = metod.Static;
            ShortDescription = metod.ShortDescription;
            Description = metod.Descrition;
            ClassId = classId;
        }

        public void Save()
        {
            GetDBId();
        }
    }
}